<div class="left-title">Sản phẩm tiêu biểu</div>
<?php echo $featured ?>

<div class="left-title"><?php echo $title?></div>
<div class="product-list">
	<?php if(count($products) <= 0 || $products == null) : ?>
		Chưa cập nhật sản phẩm.
	<?php else: ?>
		<?php foreach($products as $product){ ?>
			<div class="listview">
				<div class="row">
					<a href="<?php echo $BaseUrl?>index.php/index/product/<?php echo $product->id?>">
						<img class="thumb-img" src="<?php echo $product->image?>" alt="<?php echo $product->name?>"/><br />
						<span class="product-name"><?php
							if (strlen($product->name)>30)	{
								$product->name = substr($product->name, 0, 27)."...";
							} 
							echo $product->name ?>
						</span>
					</a>
					<span class="description"><?php echo $product->description?></span>
					<?php if((float)$product->discount > 0):?>
						<span class="origin-price-number"><?php echo $product->priceCurrency.' '.$product->price?></span>
					<?php else: ?>
						<span class="price-number"><?php echo $product->priceCurrency.' '.$product->price?></span>
					<?php endif ?>
					<span class="price-number"><?php echo $product->discountCurrency.' '.$product->discount?></span>
				</div>
			</div> <!-- end list view-->
		<?php } ?>
	<?php endif ?>
</div><!-- end product list-->

<?php if(!is_null($recentCheckedout)) : ?>
<div class="left-title">Các sản phẩm vừa được mua</div>
<div class="product-list">
	<?php if(count($recentCheckedout) <= 0 || $recentCheckedout == null) : ?>
		Chưa cập nhật sản phẩm.
	<?php else: ?>
		<?php foreach($recentCheckedout as $recent){ ?>
			<div class="listview">
				<div class="row">
					<a href="<?php echo $BaseUrl?>index.php/index/product/<?php echo $recent->id?>">
						<img class="thumb-img" src="<?php echo $recent->image?>" alt="<?php echo $recent->name?>"/><br />
						<span class="product-name"><?php
							if (strlen($recent->name)>30)	{
								$recent->name = substr($recent->name, 0, 27)."...";
							} 
							echo $recent->name ?>
						</span>
					</a>
					<span class="description"><?php echo $recent->description?></span>
					<?php if((float)$recent->discount > 0):?>
						<span class="origin-price-number"><?php echo $recent->priceCurrency.' '.$recent->price?></span>
					<?php else: ?>
						<span class="price-number"><?php echo $recent->priceCurrency.' '.$recent->price?></span>
					<?php endif ?>
					<span class="price-number"><?php echo $recent->discountCurrency.' '.$recent->discount?></span>
				</div>
			</div> <!-- end list view-->
		<?php } ?>
	<?php endif ?>
</div><!-- end product list-->
<?php endif ?>
